package 常用类.Array类.map.hashMap;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class HashMap2 {
    public static void main(String[] args) {
        Map<String,Integer> map=new HashMap<>();
        map.put("aaa",111);
        map.put("bbb",222);
        map.put("ccc",333);
        map.put("ddd",444);
        map.put("eee",555);
        //获得所有的key
        Set<String> keys=map.keySet();
        for (String key:keys){
            System.out.println(key);
        }
        System.out.println("=======================");
        //获得所有的value
        Collection<Integer> values=map.values();
        for (Integer value:values){
            System.out.println(value);
        }
    }
}
